<template>
  <div class="index-hot" >
    <div class="hot-left">
      <div class="icon">
        <img src="~/static/hot.png" >
      </div>
      <div class="title">
        <span class="t1">热门</span>
        <span class="t2">推荐</span>
      </div>
    </div>
    <div class="hot-right">
      <aside class="swiper-box"
      v-swiper:logoSwiper="sw_params.logoOption"
      @mouseenter="on_bot_enter" @mouseleave="on_bot_leave"
      ref="hotSwiper">
        <div class="swiper-wrapper" >
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗专升本考试难度大吗专升本考试难度大吗专升本考试难度大吗专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>
           <a class="hot-item swiper-slide WordJustOneLine" href="" target="_blank">专升本考试难度大吗？</a>



        </div>
      </aside>
    </div>
  </div>
</template>

<script>
export default {
  name:'index-hot',
  props:{
    text:{
      type:String,
      default:'今日推荐'
    },
    color:{
      type:String,
      default:"#333"
    },
    bgColor:{
      type:String,
      default:"#ffffff"
    }
  },
  data(){
    return {
      sw_params:{
        logoOption: {
              loop: true,
              navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
              },
              pagination: {
                el: '.swiper-pagination',
                clickable: true,
              },
              autoplay: {
                delay: 1,
              },
              speed:4000,
              slidesPerView : 4,
              spaceBetween : 10,
        },
        data:[
          {
            url:''
          }
        ]
      }
    }
  },
  computed: {
      hotSwiper() {
          return this.$refs.hotSwiper.swiper
      }
  },
  methods:{
    on_bot_enter() {
        this.hotSwiper.autoplay.stop()
    },
    on_bot_leave() {
        this.hotSwiper.autoplay.start()
    },

  }
}
</script>

<style lang="scss" scoped="scoped">
.swiper-wrapper {
  -webkit-transition-timing-function: linear;    /*之前是ease-out*/
  -moz-transition-timing-function: linear;
  -ms-transition-timing-function: linear;
  -o-transition-timing-function: linear;
  transition-timing-function: linear;
  margin: 0 auto;
}
.index-hot{
  margin-top: 20px;
  background-color: #f8fafc;
  padding: 20px 40px;
  display: flex;
  .hot-left{
    display: flex;
    align-items: center;
    width: 130px;
    .icon{
      width: 22px;
      height: 26px;
      img{
        width: 100%;
      }
    }
    .title{
      font-size: 26px;
      font-weight: bold;
      font-style: italic ;
      .t1{
        color: #000000;
      }
      .t2{
        margin-left: -10px;
        color: $active_color;
      }
    }
  }
  .hot-right{
    width: calc(100% - 130px);
    box-sizing: border-box;
    padding: 0 0 0 20px;
    .swiper-box{
      margin-top: 6px;
    }
    .hot-item{
      font-size: 14px;
      color: $active_color;
      background-color: #ffefdb;
      position: relative;
      display: block;
      padding: 5px 10px 5px 20px;
      border-radius: 3px;
      &::after{
        position: absolute;
        content: '';
        left: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 6px;
        height: 6px;
        border-radius: 6px;
        background-color: #f7cb3b;

      }
    }
  }
}
</style>
